
class Cashier:

    def __init__(self, n, discount, products, prices):
        self.n = n
        self.discount = discount
        self.product_dic = {}
        for i in zip(products, prices):
            self.product_dic[i[0]] = i[1]

        self.count = 1

    def getBill(self, product, amount):
        price = 0
        for p in zip(product, amount):
            price += self.product_dic[p[0]] * p[1]
        if self.count == self.n:
            price = price - (self.discount * price) / 100
            self.count = 0

        self.count += 1
        return round(price, 2)

# Your Cashier object will be instantiated and called as such:

# obj = Cashier(n, discount, products, prices)
# param_1 = obj.getBill(product,amount)

if __name__ == "__main__":
    cashier = Cashier(3, 50, [1, 2, 3, 4, 5, 6, 7], [
                      100, 201, 300, 400, 300, 200, 100])
    print(cashier.product_dic)
    print(cashier.getBill([1,2],[1,3]))
    print(cashier.getBill([3,7],[10,10]))
    print(cashier.getBill([1,2,3,4,5,6,7],[1,1,1,1,1,1,1]))
    print(cashier.getBill([1,2,3,4,5,6,7],[1,1,1,1,1,1,1]))
    print(cashier.getBill([1,2,3,4,5,6,7],[1,1,1,1,1,1,1]))
    print(cashier.getBill([1,2,3,4,5,6,7],[1,1,1,1,1,1,1]))
    print(cashier.getBill([1,2,3,4,5,6,7],[1,1,1,1,1,1,1]))
    print(cashier.getBill([1,2,3,4,5,6,7],[1,1,1,1,1,1,1]))
    print(cashier.getBill([1,2,3,4,5,6,7],[1,1,1,1,1,1,1]))
